package com.wangijun.yuan.web.service;

import com.wangijun.yuan.web.model.vo.CommentVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


/**
 * 功能描述: 一些事件埋置，
 * 用来处理通知
 *
 * @author wlf 2024/8/1 11:26
 */

@Slf4j
@Service
@RequiredArgsConstructor
public class NoticeEventService {
    private final NoticeService noticeService;

    /*发布文章*/
    public void pushArt(Long artId) {
        noticeService.pushArt(artId);
    }

    /*更新文章*/
    public void editArt(Long artId) {
        noticeService.editArt(artId);
    }

    /*用户关注*/
    public void followUser(Long userId, Long dataId, Integer num) {
        if (num > 0) {
            noticeService.followUser(userId, dataId);
        }
    }

    /*标签关注*/
    public void tagFollow(Long id, Integer num) {

    }

    /*话题关注*/
    public void topicFollow(Long id, Integer num) {

    }

    /*文章点赞*/
    public void likedArt(Long userId, Long dataId, Integer num) {
        if (num > 0) {
            noticeService.likedArt(userId, dataId);
        }
    }

    /*文章收藏*/
    public void favArt(Long userId, Long dataId, Integer num) {
        if (num > 0) {
          noticeService.favArt(userId,dataId);
        }
    }

    /*发布评论*/
    public void artComment(CommentVO comment) {

    }

    /*评论点赞*/
    public void likedComment(Long userId, Long dataId, Integer num) {
        if (num > 0) {
           noticeService.likedComment(userId,dataId);
        }
    }
}
